from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QSize
from .platform_detect import LinuxEnv

class TrayIcon(QSystemTrayIcon):
    def __init__(self, parent=None):
        super().__init__(parent)
        
        # 统一图标加载
        self.setIcon(QIcon("/usr/share/deskmanager/resources/tray_icon.png"))
        
        # Deepin特殊设置
        if LinuxEnv.is_deepin_v23():
            self.setIconSize(QSize(48, 48))  # DDE托盘标准尺寸
            self.setToolTip("DeskManager")